<script setup lang="ts">
// 货品运营
import {WxtBizCode, WxtUtils} from "~/contentScripts/views/wxt/lib/wxtUtils";
import GoodsOperationPlanContent
  from "~/contentScripts/views/wxt/SuperOptimization/KeywordPromotion/GoodsOperationPlanContent.vue";
import GoodsOperationUnitContent
  from "~/contentScripts/views/wxt/SuperOptimization/KeywordPromotion/GoodsOperationUnitContent.vue";
const props = defineProps({
  active: {
    type: String,
    default: 'plan',
  },
});
const type = ref(props.active);
// const adzoneList = ref<any[]>([]);
// const loadAdzoneList = async () => {
//   WxtUtils.customRequest('https://one.alimama.com/component/findList.json', WxtBizCode.精准人群推广, {
//     componentCode: 'adzoneList',
//   }).then(res => {
//     adzoneList.value = res.data.data.list[0].subComponentList[1].subComponentList;
//     console.log(adzoneList.value);
//   });
// };
// loadAdzoneList();
// const type = ref('plan');
const bizCode = ref(WxtBizCode["货品运营-货品加速"]);
</script>

<template>
  <div style="display: flex;flex-direction: column;height: 100%;position:relative;">
    <div style="position: absolute;top: -50px;right: 0">
      <a-radio-group v-model:value="type" size="small" button-style="solid">
        <a-radio-button value="plan">计划列表</a-radio-button>
        <a-radio-button value="unit">单元列表</a-radio-button>
<!--        <a-radio-button value="equity">权益列表</a-radio-button>-->
      </a-radio-group>
    </div>
    <div style="padding-bottom: 10px;">
      <a-radio-group v-model:value="bizCode" button-style="solid">
        <a-radio-button shape="round" :value="WxtBizCode['货品运营-货品加速']">货品加速</a-radio-button>
        <a-radio-button shape="round" :value="WxtBizCode['货品运营-上新快']">上新快</a-radio-button>
        <a-radio-button shape="round" :value="WxtBizCode['货品运营-测新快']">测新快</a-radio-button>
<!--        <a-radio-button shape="round" :value="WxtBizCode['消费者运营-粉丝快']">粉丝快</a-radio-button>-->
      </a-radio-group>
    </div>
    <div class="box">
      <GoodsOperationPlanContent v-if="type==='plan'" :biz-code="bizCode"/>
      <GoodsOperationUnitContent v-if="type==='unit'" name="主体" :biz-code="bizCode"/>
    </div>
  </div>
</template>

<style scoped>

.box {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
</style>
